<h2>Understanding the source code of the different notes</h2>
<p>Internally, the structure of the content of each note is different based
  on the&nbsp;<a class="reference-link" href="#root/_help_KSZ04uQ2D1St">Note Types</a>.</p>
<p>For example:</p>
<ul>
  <li><a class="reference-link" href="#root/_help_iPIMuisry3hd">Text</a>&nbsp;notes&nbsp;are
    represented internally as HTML, using the&nbsp;<a class="reference-link"
    href="#root/_help_MI26XDLSAlCD">CKEditor</a>&nbsp;representation. Note
    that due to the custom plugins, some HTML elements are specific to Trilium
    only, for example the admonitions.</li>
  <li><a class="reference-link" href="#root/_help_6f9hih2hXXZk">Code</a>&nbsp;notes&nbsp;are
    plain text and are represented internally as-is.</li>
  <li><a class="reference-link" href="#root/_help_81SGnPGMk7Xc">Geo Map</a>&nbsp;notes
    contain only minimal information (viewport, zoom) as a JSON.</li>
  <li><a class="reference-link" href="#root/_help_grjYqerjn243">Canvas</a>&nbsp;notes
    are represented as JSON, with Trilium's own information alongside with&nbsp;
    <a
    class="reference-link" href="#root/_help_H0mM1lTxF9JI">Excalidraw</a>'s internal JSON representation format.</li>
  <li><a class="reference-link" href="#root/_help_gBbsAeiuUxI5">Mind Map</a>&nbsp;notes
    are represented as JSON, with the internal format of&nbsp;<a class="reference-link"
    href="#root/_help_N4IDkixaDG9C">MindElixir</a>.</li>
</ul>
<p>Note that some information is also stored as&nbsp;<a class="reference-link"
  href="#root/_help_0vhv7lsOLy82">Attachments</a>. For example&nbsp;<a class="reference-link"
  href="#root/_help_grjYqerjn243">Canvas</a>&nbsp;notes use the attachments
  feature to store the custom libraries, and alongside with&nbsp;<a class="reference-link"
  href="#root/_help_gBbsAeiuUxI5">Mind Map</a>&nbsp;and other similar note
  types it stores an SVG representation of the content for use in other features
  such as including in other notes, shared notes, etc.</p>
<p>Here's part of the HTML representation of this note, as it's stored in
  the database (but prettified).</p><pre><code class="language-text-x-trilium-auto">&lt;h2&gt;
	Understanding the source code of the different notes
&lt;/h2&gt;
&lt;p&gt;
	Internally, the structure of the content of each note is different based on the&amp;nbsp;
	&lt;a class="reference-link" href="#root/_help_KSZ04uQ2D1St"&gt;
		Note Types
	&lt;/a&gt;
	.
&lt;/p&gt;</code></pre>
<h2>Viewing the source code</h2>
<p>It is possible to view the source code of a note by pressing the contextual
  menu in&nbsp;<a class="reference-link" href="#root/_help_8YBEPzcpUgxw">Note buttons</a>&nbsp;and
  selecting <em>Note source</em>.</p>
<p>
  <img src="Note source_image.png">
</p>
<p>The source code will be displayed in a new tab.</p>
<p>For some note types, such as text notes, the source code is also formatted
  in order to be more easily readable.</p>
<h2>Modifying the source code</h2>
<p>It is possible to modify the source code of a note directly, however not
  via the <em>Note source</em> functionality.&nbsp;</p>
<p>To do so:</p>
<ol>
  <li>Change the note type from the real note type (e.g. Canvas, Geo Type) to
    Code (plain text) or the corresponding format such as JSON or HTML.</li>
  <li>Confirm the warning about changing the note type.</li>
  <li>The source code will appear, make the necessary modifications.</li>
  <li>Change the note type back to the real note type.</li>
</ol>
<aside class="admonition warning">
  <p>Depending on the changes made, there is a risk that the note will not
    render properly. It's best to save a revision before making any big changes.</p>
  <p>If the note does not render properly, modify the source code again or
    revert to a prior revision. Since the error handling for unexpected changes
    might not always be perfect, it be required to refresh the application.</p>
</aside>